home *** CD-ROM | disk | FTP | other *** search
- Path: library.erc.clarkson.edu!rpi!not-for-mail
- From: kasslar@aol.com (Kasslar)
- Newsgroups: comp.lang.c++,comp.lang.c++.moderated
- Subject: Re: Argc & Argv
- Date: 28 Feb 1996 03:30:02 -0000
- Organization: America Online, Inc. (1-800-827-6364)
- Sender: cppmods@netlab.cs.rpi.edu
- Approved: herbs@connobj.com
- Message-ID: <4h0i7q$4sg@netlab.cs.rpi.edu>
- References: <4gta9f$df5@netlab.cs.rpi.edu>
- Reply-To: kasslar@aol.com (Kasslar)
- NNTP-Posting-Host: netlab.cs.rpi.edu
- X-Original-Date: 27 Feb 1996 14:54:16 -0500
-
- You can never explicitly call a constructor, and since your objects in
- this case are global they must be constructed out side of main. No can do.
- How 'bout Global pointers to your objects and constucting the objects on
- the free store in main?
-
- T * po;
-
- void main( int argc, char ** argv )
- {
- po = new T(argv);
- }
-
-
- The other option is to of course write a method for your global that main
- can call to pass argv in.
-
- Regards,
- Randy Abernethy
- ----------------------------------------
- Randy Abernethy
- Kasslar Enterprises
- kasslar@aol.com
- randya@spectralinc.com
- rabernethy@spectralinc.com
- ----------------------------------------
-
- Randy Abernethy
- Kasslar Enterprises
- kasslar@aol.com
-
- [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
- [ Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm ]
- [ Moderation policy: http://www.connobj.com/cpp/guide.htm ]
- [ Comments? mailto:c++-request@netlab.cs.rpi.edu ]
-